let tqType =[
  {
      "wid": "00",
      "weather": "晴",
      "weatherEn":'Sunny',
      "weatherTw":'晴',
  },
  {
      "wid": "01",
      "weather": "多云",
      "weatherEn":'Cloudy',
      "weatherTw":'多雲',
  },
  {
      "wid": "02",
      "weather": "阴",
      "weatherEn":'Overcast',
      "weatherTw":'陰',
  },
  {
      "wid": "03",
      "weather": "阵雨",
      "weatherEn":'Showers',
      "weatherTw":'陣雨',
  },
  {
      "wid": "04",
      "weather": "雷阵雨",
      "weatherEn":'Thunderstorm',
      "weatherTw":'雷陣雨',
  },
  {
      "wid": "05",
      "weather": "雷阵雨伴有冰雹",
      "weatherEn":'Thunderstorm with Hail',
      "weatherTw":'雷陣雨伴有冰雹',
  },
  {
      "wid": "06",
      "weather": "雨夹雪",
      "weatherEn":'Rain and Snow',
      "weatherTw":'雨夾雪',
  },
  {
      "wid": "07",
      "weather": "小雨",
      "weatherEn":'Light Rain',
      "weatherTw":'小雨',
  },
  {
      "wid": "08",
      "weather": "中雨",
      "weatherEn":'Middle Rain',
      "weatherTw":'中雨',
  },
  {
      "wid": "09",
      "weather": "大雨",
      "weatherEn":'Heavy Rain',
      "weatherTw":'大雨',
  },
  {
      "wid": "10",
      "weather": "暴雨",
      "weatherEn":'Rainstorm',
      "weatherTw":'暴雨',
  },
  {
      "wid": "11",
      "weather": "大暴雨",
      "weatherEn":'Torrential Rain',
      "weatherTw":'大暴雨',
  },
  {
      "wid": "12",
      "weather": "特大暴雨",
      "weatherEn":'Rainstorm to Torrential Rain',
      "weatherTw":'特大暴雨',
  },
  {
      "wid": "13",
      "weather": "阵雪",
      "weatherEn":'Snow Shower',
      "weatherTw":'陣雪',
  },
  {
      "wid": "14",
      "weather": "小雪",
      "weatherEn":'Little Snow',
      "weatherTw":'小雪',
  },
  {
      "wid": "15",
      "weather": "中雪",
      "weatherEn":'Middle Sonw',
      "weatherTw":'中雪',
  },
  {
      "wid": "16",
      "weather": "大雪",
      "weatherEn":'Heavy snow',
      "weatherTw":'大雪',
  },
  {
      "wid": "17",
      "weather": "暴雪",
      "weatherEn":'Blizzard',
      "weatherTw":'暴雪',
  },
  {
      "wid": "18",
      "weather": "雾",
      "weatherEn":'Fog',
      "weatherTw":'霧',
  },
  {
      "wid": "19",
      "weather": "冻雨",
      "weatherEn":'Freezing Rain',
      "weatherTw":'凍雨',
  },
  {
      "wid": "20",
      "weather": "沙尘暴",
      "weatherEn":'Sandstorm',
      "weatherTw":'沙塵暴',
  },
  {
      "wid": "21",
      "weather": "小到中雨",
      "weatherEn":'Light to Moderate Rain',
      "weatherTw":'小到中雨',
  },
  {
      "wid": "22",
      "weather": "中到大雨",
      "weatherEn":'Heavy to Rainstorm',
      "weatherTw":'中到大雨',
  },
  {
      "wid": "23",
      "weather": "大到暴雨",
      "weatherEn":'Heavy to Rainstorm',
      "weatherTw":'大到暴雨',
  },
  {
      "wid": "24",
      "weather": "暴雨到大暴雨",
      "weatherEn":'Rainstorm to Rainstorm',
      "weatherTw":'暴雨到大暴雨',
  },
  {
      "wid": "25",
      "weather": "大暴雨到特大暴雨",
      "weatherEn":'Rainstorm to Torrential Rain',
      "weatherTw":'大暴雨到特大暴雨',
  },
  {
      "wid": "26",
      "weather": "小到中雪",
      "weatherEn":'Light to Moderate Snow',
      "weatherTw":'小到中雪',
  },
  {
      "wid": "27",
      "weather": "中到大雪",
      "weatherEn":'Moderate to Heavy Snow',
      "weatherTw":'中到大雪',
  },
  {
      "wid": "28",
      "weather": "大到暴雪",
      "weatherEn":'Big to Blizzard',
      "weatherTw":'大到暴雪',
  },
  {
      "wid": "29",
      "weather": "浮尘",
      "weatherEn":'Floating Dust',
      "weatherTw":'浮塵',
  },
  {
      "wid": "30",
      "weather": "扬沙",
      "weatherEn":'Blowing Sands',
      "weatherTw":'揚沙',
  },
  {
      "wid": "31",
      "weather": "强沙尘暴",
      "weatherEn":'Strong Sandstorm',
      "weatherTw":'强沙塵暴',
  },
  {
      "wid": "53",
      "weather": "霾",
      "weatherEn":'Haze',
      "weatherTw":'霾',
  }
]

function getTqDesc({day, night}){
  let desc = ""
  let toDesc = ""
  tqType.map(item=>{
      if(item.wid == day){
        desc = getLangDesc(item)
      }
      if(item.wid == night){
        toDesc = getLangDesc(item)
      }
  })
  if(desc == toDesc){
    return desc
  }
  return desc + arr[wx.getStorageSync('lang')] + toDesc;
}

let arr = ['','转','轉',' to '] 

function getLangDesc(item){
  let lang = wx.getStorageSync('lang');
  if(lang == 1){
    return item.weather
  }else if (lang == 2){
    return item.weatherTw
  }else{
    return item.weatherEn
  }
}

module.exports = {
  getTqDesc:getTqDesc
}
